package org.project.d.network.coder;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;
import org.project.d.network.protocol.Packet;

/**
 * @author lin
 * @version V1.0
 * @description
 * @date 2020/6/11 4:42 下午
 */
@ChannelHandler.Sharable
public class PacketEncoder extends MessageToByteEncoder<Packet> {


    @Override
    protected void encode(ChannelHandlerContext ctx, Packet msg, ByteBuf out) throws Exception {
        Packet.encodePacket(msg,out);
    }
}
